package com.duobao.uitl;

public class Gaili {
    private Gaili()
    {

    }
    public static boolean taopao(int a,int b)//TRUE 逃跑成功      a逃跑  b追击
    {
        boolean bo=false;//b差a 50级 一定会逃跑
        float rand=(float) (Math.random());
        if((float)(a/b)/2>rand)//判断a/b的比例
        {
            bo=true;
        }else
        {
            bo=false;
        }
        return bo;
    }
    public static boolean gongji(int a,int b)
    {
        boolean bo=true;
        int rand=(int) ((Math.random()*(a+b)));
        if(rand<a+10)
        {
            bo=true;
        }else
        {
            bo=false;
        }
        return bo;
    }
    public static boolean zhangdou(int a,int b)//true 命中
    {
        boolean bo=true;
        if(a>=b)
        {

            int i=(int)(Math.random()*(50+(a-b)))+1;
            if(i<=20)
            {
                bo=false;
            }else
            {
                bo=true;
            }
        }else
        {
            int i=(int)(Math.random()*(50+(b-a)))+1;
            if(i<=30)
            {
                bo=true;
            }else
            {
                bo=false;
            }
        }
        return bo;
    }
}
